import deepcopy from "deepcopy";
export default  store => {
    const styles = [ 
      'padding-right:10px;',
      'color:#fff',
      'background:red',
      'font-size:15px',
      'border-radius:3px'
    ].join(";"); 
    
    let prevState = deepcopy(store.state);
    store.subscribe((mutation, state) => {
      console.groupCollapsed(`%c 你提交了mutation: %c ${mutation.type}`,'font-size:15px;color:#f60;',styles)
      console.groupCollapsed('%c prevState','color:green;')
      console.log(prevState);
      console.groupEnd()
      console.groupCollapsed('%c nextState','color:red;')
      console.log(deepcopy(state));
      console.groupEnd()
      console.groupEnd()
    });
  };